/**
 * 
 */
package sv.gob.mh.dgii.model;

import java.io.Serializable;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author melvin.henriquez
 * 
 */
@Entity
@Table(name = "DV_PAGO_INDEB_RENTA", schema = "DEVOLUCIONES")
public class DvPagoIndebRenta implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -580467646967406656L;
	private Long iindice;
	private EdDeclaraciones edDeclaraciones;
	private String nfolio;
	private RcRuc rcRuc;
	private Date fpInicio;
	private Date fpFinal;
	private String nitrepresentante;
	private String snombreRepresentante;
	private Double vsolicitado;
	private String svalorLetras;
	private Date fpresentacion;
	private Double vtotalPagoIndebido;
	private String dpagoInd;
	private Set<DvPagoIndebRentaDet> dvPagoIndebRentaDets = new HashSet<DvPagoIndebRentaDet>(
			0);

	public DvPagoIndebRenta() {
		// TODO Auto-generated constructor stub
	}

	public DvPagoIndebRenta(Long iindice) {
		this.iindice = iindice;
	}

	public DvPagoIndebRenta(Long iindice, String nfolio, RcRuc rcRuc,
			Date fpInicio, Date fpresentacion) {
		this.iindice = iindice;
		this.nfolio = nfolio;
		this.rcRuc = rcRuc;
		this.fpInicio = fpInicio;
		this.fpresentacion = fpresentacion;

	}

	/**
	 * @return the iindice
	 */
	@Id
	@Column(name = "I_INDICE", nullable = false, precision = 18, scale = 0)
	public Long getIindice() {
		return iindice;
	}

	/**
	 * @param iindice
	 *            the iindice to set
	 */
	public void setIindice(Long iindice) {
		this.iindice = iindice;
	}

	/**
	 * @return the edDeclaraciones
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "I_INDICE", unique = true, nullable = false, insertable = false, updatable = false)
	public EdDeclaraciones getEdDeclaraciones() {
		return edDeclaraciones;
	}

	/**
	 * @param edDeclaraciones
	 *            the edDeclaraciones to set
	 */
	public void setEdDeclaraciones(EdDeclaraciones edDeclaraciones) {
		this.edDeclaraciones = edDeclaraciones;
	}

	/**
	 * @return the nfolio
	 */
	@Column(name = "N_FOLIO", nullable = false, length = 12)
	public String getNfolio() {
		return nfolio;
	}

	/**
	 * @param nfolio
	 *            the nfolio to set
	 */
	public void setNfolio(String nfolio) {
		this.nfolio = nfolio;
	}

	/**
	 * @return the rcRuc
	 */
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "NIT")
	public RcRuc getRcRuc() {
		return rcRuc;
	}

	/**
	 * @param rcRuc
	 *            the rcRuc to set
	 */
	public void setRcRuc(RcRuc rcRuc) {
		this.rcRuc = rcRuc;
	}

	/**
	 * @return the fpInicio
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = true, name = "FP_INICIO", length = 7, nullable = false, updatable = true)
	public Date getFpInicio() {
		return fpInicio;
	}

	/**
	 * @param fpInicio
	 *            the fpInicio to set
	 */
	public void setFpInicio(Date fpInicio) {
		this.fpInicio = fpInicio;
	}

	/**
	 * @return the fpFinal
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = true, name = "FP_FINAL", length = 7, updatable = true)
	public Date getFpFinal() {
		return fpFinal;
	}

	/**
	 * @param fpFinal
	 *            the fpFinal to set
	 */
	public void setFpFinal(Date fpFinal) {
		this.fpFinal = fpFinal;
	}

	/**
	 * @return the nitrepresentante
	 */
	@Column(name = "NIT_REPRESENTANTE", nullable = false, length = 14)
	public String getNitrepresentante() {
		return nitrepresentante;
	}

	/**
	 * @param nitrepresentante
	 *            the nitrepresentante to set
	 */
	public void setNitrepresentante(String nitrepresentante) {
		this.nitrepresentante = nitrepresentante;
	}

	/**
	 * @return the snombreRepresentante
	 */
	@Column(name = "S_NOMBRE_REPRESENTANTE", nullable = true, length = 100)
	public String getSnombreRepresentante() {
		return snombreRepresentante;
	}

	/**
	 * @param snombreRepresentante
	 *            the snombreRepresentante to set
	 */
	public void setSnombreRepresentante(String snombreRepresentante) {
		this.snombreRepresentante = snombreRepresentante;
	}

	/**
	 * @return the vsolicitado
	 */
	@Column(name = "V_SOLICITADO", nullable = false, precision = 12, scale = 2)
	public Double getVsolicitado() {
		return vsolicitado;
	}

	/**
	 * @param vsolicitado
	 *            the vsolicitado to set
	 */
	public void setVsolicitado(Double vsolicitado) {
		this.vsolicitado = vsolicitado;
	}

	/**
	 * @return the svalorLetras
	 */
	@Column(name = "S_VALOR_LETRAS", nullable = true, length = 1024)
	public String getSvalorLetras() {
		return svalorLetras;
	}

	/**
	 * @param svalorLetras
	 *            the svalorLetras to set
	 */
	public void setSvalorLetras(String svalorLetras) {
		this.svalorLetras = svalorLetras;
	}

	/**
	 * @return the fpresentacion
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(insertable = true, name = "F_PRESENTACION", length = 7, nullable = false, updatable = true)
	public Date getFpresentacion() {
		return fpresentacion;
	}

	/**
	 * @param fpresentacion
	 *            the fpresentacion to set
	 */
	public void setFpresentacion(Date fpresentacion) {
		this.fpresentacion = fpresentacion;
	}

	/**
	 * @return the vtotalPagoIndebido
	 */
	@Column(name = "V_TOTAL_PAGO_INDEBIDO", nullable = true, precision = 12, scale = 2)
	public Double getVtotalPagoIndebido() {
		return vtotalPagoIndebido;
	}

	/**
	 * @param vtotalPagoIndebido
	 *            the vtotalPagoIndebido to set
	 */
	public void setVtotalPagoIndebido(Double vtotalPagoIndebido) {
		this.vtotalPagoIndebido = vtotalPagoIndebido;
	}

	/**
	 * @return the dpagoInd
	 */
	@Column(insertable = true, name = "D_PAGO_IND", length = 255, nullable = true, updatable = true)
	public String getDpagoInd() {
		return dpagoInd;
	}

	/**
	 * @param dpagoInd
	 *            the dpagoInd to set
	 */
	public void setDpagoInd(String dpagoInd) {
		this.dpagoInd = dpagoInd;
	}

	/**
	 * @return the dvPagoIndebRentaDets
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dvPagoIndebRenta")
	public Set<DvPagoIndebRentaDet> getDvPagoIndebRentaDets() {
		return dvPagoIndebRentaDets;
	}

	/**
	 * @param dvPagoIndebRentaDets
	 *            the dvPagoIndebRentaDets to set
	 */
	public void setDvPagoIndebRentaDets(
			Set<DvPagoIndebRentaDet> dvPagoIndebRentaDets) {
		this.dvPagoIndebRentaDets = dvPagoIndebRentaDets;
	}

}
